﻿using Microsoft.Extensions.DependencyInjection;
using System;

namespace Infrasturcture.DapperLight
{
    public static class DapperLightExtensions
    {
        public static void AddDapper(this IServiceCollection services, string name, Action<DapperLightOption> options)
        {
            services.Configure<DapperFactoryOptions>(name, o => o.DapperActions.Add(options));

            services.AddSingleton<IDapperFactory, DapperFactory>();
        }
    }

}
